import { mock, Random } from 'mockjs'

const loginConfig = [
    {
        url: '/api/login',
        method: "post",
        render: config => { 
            const {account} = JSON.parse(config.body)
            return mock({
                code: 200,
                'data': {
                    'id': 54,
                    'name': account,
                    'age': '@natural(16, 80)',
                    'address': '@county(true)',
                    'avatar':`@image('200x200', '#50B347', '#FFF', '头像')`,
                    "rules": () => ['nice', 'developer', 'loser', 'cool', 'teacher'].filter(() => Math.random() - 0.5 > 0)
                }
            })
        }
    }
]

export default loginConfig

